waypt: Add function 'waypt_disp_session'.
authoroliskoli <oliskoli>
Sun, 7 Sep 2008 16:46:59 +0000 (16:46 +0000)
committeroliskoli <oliskoli>
Sun, 7 Sep 2008 16:46:59 +0000 (16:46 +0000)
waypt.c

diff --git a/waypt.c b/waypt.c
index 7ff60bf277e727df4e442298831dc3c866ce964b..065f388dd7be6dd5223788fd15029f08f27c56bc 100644 (file)
--- a/waypt.c
+++ b/waypt.c
@@ -244,21 +244,7 @@ waypt_status_disp(int total_ct, int myct)
 void
 waypt_disp_all(waypt_cb cb)
 {
-       queue *elem, *tmp;
-       waypoint *waypointp;
-       int i = 0;
-
-       QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-               waypointp = (waypoint *) elem;
-               if (global_opts.verbose_status) {
-                       i++;
-                       waypt_status_disp(waypt_ct, i);
-               }
-               (*cb) (waypointp);
-       }
-       if (global_opts.verbose_status) {
-               fprintf(stdout, "\r\n");
-       }
+       waypt_disp_session(NULL, cb);
 }
 
 void
@@ -270,7 +256,7 @@ waypt_disp_session(const session_t *se, waypt_cb cb)
 
        QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
                waypointp = (waypoint *) elem;
-               if (waypointp->session == se) {
+               if ((se == NULL) || (waypointp->session == se)) {
                        if (global_opts.verbose_status) {
                                i++;
                                waypt_status_disp(waypt_ct, i);